package views.homme;

import java.awt.*;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 *
 */
public class SexeCellRenderer extends DefaultTableCellRenderer
{
	private Icon manImage;
	private Icon womanImage;

	public SexeCellRenderer()
	{
		super();
		manImage = new ImageIcon("img/man.png");
		womanImage = new ImageIcon("img/woman.png");
	}


	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
	{
		super.getTableCellRendererComponent(table, null, isSelected, hasFocus, row, column);

		Boolean m_value = (Boolean)value;

		if(m_value)
		{
			setText("Homme");
			setIcon(manImage);
		}
		else
		{
			setText("Femme");
			setIcon(womanImage);
		}

		return this;
	}
}